/*
ccp 1.2
Implement a function void reverse(char* str) in C or C++ which reverses a null-terminated string.
*/
#include <iostream>
#include <string.h>
#include <stdio.h>
using namespace std;


void Reverse(char* str)
{
	int i = 0;
	int j = strlen(str)-1;
	while(i < j)
	{
		swap(str[i],str[j]);
		i++;
		j--;
	}
	
}

int main()
{
	char str[] = "abcdefg";
	printf("%s\n",str);
	Reverse(str);
	printf("%s\n",str);
	return 0;
}